//
// var_string.cpp for  in /home/faucon_l//Work/Tek2/maths/tmp
//
// Made by leo faucon
// Login   <faucon_l@epitech.net>
//
// Started on  Thu Mar 31 19:29:33 2011 leo faucon
// Last update Fri Apr 29 19:01:24 2011 leo faucon
//

#ifndef _CONVERT_HPP_
# define _CONVERT_HPP_

#include <sstream>
#include <iomanip>

template<typename T>
void	string_to_var(T &var, const std::string &str)
{
  std::istringstream s(str);
  s >> var;
}

template<typename T>
std::string	var_to_string(T &var, int precision)
{
  std::string	str;
  std::ostringstream s;
  s << std::fixed << std::setprecision(precision) << var;
  str = s.str();
  return (str);
}

#endif
